package com.mini.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * Created with meng.
 * User: meng5
 * Date: 2019-10-30
 * Description:
 */
@Data
@ApiModel(value = "数据统计对象")
public class MiniStatisticDataVO {
    @ApiModelProperty(value = "id")
    private Long id;
    @ApiModelProperty(value = "计划名称")
    private String planName;
    @ApiModelProperty(value = "计划id")
    private String planId;
    @ApiModelProperty(value = "pv")
    private Long pv  = 0L;
    @ApiModelProperty(value = "uv")
    private Long uv  = 0L;
    @ApiModelProperty(value = "表单名片")
    private Long formCardTotal  = 0L;
    @ApiModelProperty(value = "支付名片")
    private Long payCardTotal  = 0L;
    @ApiModelProperty(value = "小课流水")
    private Double courseMoney  = 0.0;
    @ApiModelProperty(value = "加微人数")
    private Long addWxTotal  = 0L;
    @ApiModelProperty(value = "未加微人数=支付名片数-加微人数")
    private Long unAddWxTotal;
    @ApiModelProperty(value = "工作室id")
    private String workRoomId;
    @ApiModelProperty(value = "工作室名称")
    private String workRoomName;
    @ApiModelProperty(value = "负责人id")
    private String respId;
    @ApiModelProperty(value = "负责人名称")
    private String respName;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    @ApiModelProperty(value = "是否有效：1-有效，0-无效")
    private Integer isUsed;
    @ApiModelProperty(value = "小课业务id")
    private String miniLessonId;
    @ApiModelProperty(value = "统计日期")
    private Date miniDate;
    @ApiModelProperty(value = "大课流水")
    private Double bigCourseMoney  = 0.0;
    @ApiModelProperty(value = "[20200722]大课流水")
    private Double bigCourseMoneyAll  = 0.0;

    @ApiModelProperty(value = "app注册数量")
    private Long appRegisterNum  = 0L;

    @ApiModelProperty(value = "发送短信数量")
    private Long smsSendNum  = 0L;

    @ApiModelProperty(value = "领取优惠劵的数量")
    private Long getCouponNum = 0L;


    @ApiModelProperty(value = "运营组ID")
    private Long groupId;

    @ApiModelProperty(value = "运营组名称")
    private String groupName;

    @ApiModelProperty(value = "渠道标识")
    private String channelCode;

    @ApiModelProperty(value = "渠道名称")
    private String channelName;

    @ApiModelProperty(value = "运营组IDs")
    private String groupIds;

    @ApiModelProperty(value = "运营组名称s")
    private String groupNames;

    @ApiModelProperty(value = "大课订单")
    private Long bigCourseOrderCount = 0L;

    @ApiModelProperty(value = "有赞流水")
    private Double youzanMoney = 0.0;

    @ApiModelProperty(value = "集团流水")
    private Double companyMoney = 0.0;

    @ApiModelProperty(value = "集团退款")
    private Double companyRefund = 0.0;

    @ApiModelProperty(value = "有赞退款")
    private Double youzanRefund = 0.0;

    @ApiModelProperty(value = "直播带货订单数")
    private Long liveSellCount = 0L;

    @ApiModelProperty(value = "直播带货流水")
    private Double liveSellMoney = 0.0;

    @ApiModelProperty(value = "小程序流水")
    private Double xcxMoney = 0.0;

    @ApiModelProperty(value = "小程序退款")
    private Double xcxRefund = 0.0;

    @ApiModelProperty(value = "显示字段,ALL 为全部显示,其他情况为 字段名称用,分割")
    private String fields = "ALL";

    @ApiModelProperty(value = "小程序退款单数")
    private Long xcxRefundCount = 0L;

    @ApiModelProperty(value = "有赞退款单数")
    private Long youzanRefundCount = 0L;

    @ApiModelProperty(value = "集团退款单数")
    private Long companyRefundCount = 0L;

    @ApiModelProperty(value = "小课站点名称")
    private String miniLessonName;

    @ApiModelProperty(value = "小课名称")
    private String lessonName;

    @ApiModelProperty(value = "[20200722]有赞流水(全部）")
    private Double youzanMoneyAll = 0D;
    @ApiModelProperty(value = "[20200722]直播带货订单数(全)")
    private Long liveSellCountAll = 0L;
    @ApiModelProperty(value = "[20200722]直播带货流水(全)")
    private Double liveSellMoneyAll = 0D;
    @ApiModelProperty(value = "[20200722]小程序流水(全)")
    private Double xcxMoneyAll = 0D;

    @ApiModelProperty(value = "站点类型 0：飞天 1：传统")
    private Integer siteType;

    @ApiModelProperty(value = "站点类型 0：飞天 1：传统")
    private String siteTypeName;

    @ApiModelProperty(value = "机会数")
    private Long chanceTotal = 0L;

    @ApiModelProperty(value = "项目名称")
    private String itemName;

    @ApiModelProperty(value = "项目id")
    private Integer itemId;

    @ApiModelProperty(value = "已支付星图站点")
    private String xingtuSite;

    @ApiModelProperty(value = "SKU")
    private String skuName;

    @ApiModelProperty(value = "skuCode")
    private String skuCode;

    @ApiModelProperty(value = "创意")
    private String idea;



    @ApiModelProperty(value = "未支付星图站点")
    private String unPaySiteId;
    @ApiModelProperty(value = "已支付星图站点")
    private String paySiteId;
    @ApiModelProperty(value = "业务线")
    private String businessType;

/*    public String getBusinessType() {
        if (StringUtil.isEmpty(businessType) || "0".equals(businessType)) {
            return "加盐";
        } else {
            return "集团";
        }
    }*/

    public String getSiteTypeName() {
        if(siteType == null || siteType == 0){
            return "小课业务";
        }else {
            return "传统机会";
        }
    }

    public Long getUnAddWxTotal() {
        Long total = getPayCardTotal() == null ? 0L : getPayCardTotal();
        Long add = getAddWxTotal() == null ? 0L : getAddWxTotal();
        unAddWxTotal = total - add;
        return unAddWxTotal;
    }
}